package svc

import (
	"gitee.com/shijun123456/api-votes/internal/config"
	"gitee.com/shijun123456/api-votes/internal/middleware"
	"gitee.com/shijun123456/srpcinterface/interface/votes"
	"github.com/tal-tech/go-zero/rest"
)

type ServiceContext struct {
	Config    config.Config
	Usercheck rest.Middleware
	Voter     votes.Voter
	Xindalu   votes.Xindaluer
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:    c,
		Usercheck: middleware.NewUsercheckMiddleware().Handle,
		Voter:     votes.New().Init(),
		Xindalu:   new(votes.Xindalu).Init(),
	}
}
